#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sys/types.h>
#include<unistd.h>
#include<pthread.h>


void* mythread(void *arg)
{
	printf("child thread,pid=[%d],id=[%ld]\n",getpid(),pthread_self());
}


int main()
{
	pthread_t thread; //返回线程号	
	int ret = pthread_create(&thread,NULL,mythread,NULL);
	if(ret != 0)
	{
		printf("thread creat error,[%s]\n",strerror(ret));
		return -1;
	} 

	printf("child thread,pid=[%d],id=[%ld]\n",getpid(),pthread_self());

	//目的是为了让子线程能够执行起来
	sleep(1);


	return 0;
}
